home *** CD-ROM | disk | FTP | other *** search
/ User's Choice Windows CD / User's Choice Windows CD (CMS Software)(1993).iso / win_a_d / cp_80a.zip / CMDPOST1.CP_ < prev    next >
Text File  |  1992-10-15  |  24KB  |  620 lines

  1. ; CmdPost menu initialization code
  2.  
  3.         ; Initialize a few variables here. 
  4.         cr=strcat(num2char(13),num2char(10))
  5.         crlf=cr
  6.         tab=num2char(9)
  7.         IniFile="WWW-PROD.INI"
  8.         IniSection="CmdPost"
  9.         AppName="Command Post"
  10.         Sounds(0)  ;Turn sounds off awhile
  11.         a=Version()
  12.         HomeBase=DirHome()
  13.         Editor=inireadpvt(IniSection,"Editor","Notepad.exe",IniFile)
  14.         CopyMoveDefault=""
  15.         if (NetGetCaps(2)==0) then MenuChange("FileNetwork",@DISABLE)
  16.  
  17.  
  18. ; Setting up the View menu item here.
  19.         a=inireadpvt(IniSection,"ViewSetup","NO",IniFile)
  20.         if a=="NO" then goto DEFSETUP
  21.  
  22.         ViewShortLong=inireadpvt(IniSection,"ViewShortLong","SHORT",IniFile)
  23.  
  24.         if ViewShortLong=="SHORT" then MenuChange("ViewShort",@CHECK)
  25.         if ViewShortLong=="LONG" then MenuChange("ViewLong",@CHECK)
  26.         
  27.         ViewBy=inireadpvt(IniSection,"ViewBy","NAME",IniFile)
  28.         if ViewBy=="NAME" then MenuChange("ViewByName",@CHECK)
  29.         if ViewBy=="DATE" then MenuChange("ViewByDate",@CHECK)
  30.         if ViewBy=="SIZE" then MenuChange("ViewBySize",@CHECK)
  31.         if ViewBy=="KIND" then MenuChange("ViewByKind",@CHECK)
  32.         if ViewBy=="UNSORTED" then MenuChange("ViewUnsorted",@CHECK)
  33.  
  34.         ViewWhat=inireadpvt(IniSection,"ViewWhat","ALL",IniFile)
  35.         if ViewWhat=="ALL" then MenuChange("ViewAll",@CHECK)
  36.         if ViewWhat=="PARTIAL" then MenuChange("ViewPartial",@CHECK)
  37.         if ViewWhat=="PROGRAMS" then MenuChange("ViewPrograms",@CHECK)
  38.  
  39.         SD3="*.*"
  40.         if ViewWhat=="PROGRAMS" then SD3="*.EXE *.COM *.BAT *.PIF"
  41.         if ViewWhat=="PARTIAL" then SD3=inireadpvt(IniSection,"Partial","*.*",IniFile)
  42.         SetDisplay(ViewShortLong,ViewBy,SD3)
  43.         drop(ViewShortLong,ViewBy,ViewWhat,SD3)
  44.         goto PRINTSETUP
  45.  
  46.         :DEFSETUP
  47.         SetDisplay("SHORT","NAME","*.*")
  48.         MenuChange("ViewAll",@CHECK)
  49.         MenuChange("ViewByName",@CHECK)
  50.         MenuChange("ViewShort",@CHECK)
  51.  
  52. ; Setup Print menu item...Kill it if no text printer
  53.         :PRINTSETUP
  54.         MenuChange("FilePrint", (inireadpvt(IniSection,"TextPrinter","",IniFile)=="NONE") *@DISABLE)
  55.         
  56.         if IsRunning() then goto goombye
  57.         a=inireadpvt(IniSection,"AutoStart","NO",IniFile)
  58.         if a!="YES" then goto goombye
  59.  
  60.         ;if Display(3,"Auto Startup","Hit any key to bypass WIN.INI%CR%Run= and Load= processing") then goto goombye
  61.         f=DirGet()
  62.         a=iniread("windows","load","")
  63.         b=ItemCount(a," ")
  64.         d=0
  65.         :woop1
  66.         if d==b then goto dorun
  67.         d=d+1
  68.         c=ItemExtract(d,a," ")
  69.         if strupper(FileRoot(c))=="CMDPOST) then goto woop1
  70.         e=FilePath(c)
  71.         if e!="" then DirChange(e)
  72.         Runicon(c,"")
  73.         goto woop1
  74.         
  75.         :dorun
  76.         a=iniread("windows","run","")
  77.         b=ItemCount(a," ")
  78.         d=0
  79.         :woop2
  80.         if d==b then goto resetdir
  81.         d=d+1
  82.         c=ItemExtract(d,a," ")
  83.         if strupper(FileRoot(c))=="CMDPOST) then goto woop2
  84.         e=FilePath(c)
  85.         if e!="" then DirChange(e)
  86.         Run(c,"")
  87.         goto woop2
  88.  
  89.         :resetdir
  90.         DirChange(f)
  91.         :goombye
  92.         Sounds(1) ;Sounds on
  93.         drop(a,b,c,d,e,f)
  94.  
  95. ; And the main menu starts.  
  96. &File
  97.  &Run...
  98.         r=CurrentFile()
  99.         if !IsKeyDown(@SHIFT) then r=askline("RUN","Enter file to run",r)
  100.         r=strcat(strtrim(r)," ")
  101.         i=strindex(r," ",0,@FWDSCAN)
  102.         a=strsub(r,1,i-1)
  103.         b=strtrim(strsub(r,i,strlen(r)-i+1))
  104.         run("%a%","%b%")
  105.         drop(a,b,r,i)        
  106.  &Load...
  107.         r=CurrentFile()
  108.         if !IsKeyDown(@SHIFT) then l=askline("LOAD","Enter file to load",CurrentFile())
  109.         l=strcat(strtrim(l)," ")
  110.         i=strindex(l," ",0,@FWDSCAN)
  111.         a=strsub(r,1,i-1)
  112.         b=strtrim(strsub(r,i,strlen(r)-i+1))
  113.         runicon("%a%","%b%")
  114.         drop(a,b,i,l)
  115.  Bro&wse...   \ {F3}
  116.         l=CurrentFile()
  117.         ;if !IsKeyDown(@SHIFT) then l=strtrim(askline("Browse","Enter file to browse",l))
  118.         a=FileLocate("browser.exe")
  119.         if a=="" then a="%HomeBase%browser.exe"
  120.         run(a,l)
  121.         drop(a,l)
  122.  &Edit...    \ {F4}
  123.         l=CurrentFile()
  124.         ;if !IsKeyDown(@SHIFT) then l=askline("Edit","Enter file to edit",l)
  125.         if l=="" || l==" " then goto NULL
  126.         a=strscan(l,".\",0,@BACKSCAN)
  127.         if a==0 then l=strcat(l,".")
  128.         if a==0 then goto NULL
  129.         if strsub(l,a,1)!="." then l=strcat(l,".")
  130.      :NULL
  131.         run(Editor,strtrim(l))
  132.         drop(a,b,l)
  133.  &Copy... \ {F8} 
  134.         r=OtherDir()
  135.         if r!=DirGet() then goto NEXT
  136.         if CopyMoveDefault!="" then r=CopyMoveDefault
  137.         :NEXT
  138.         s=strcat(DirItemize("")," ",FileItemize(""))
  139.         terminate(strlen(s)==1,"Copy Error","No files selected")
  140.         if !IsKeyDown(@SHIFT) then r=strtrim(askline("Copy",StrCat(s,CR,CR,"to"),r))
  141.         terminate(r=="","Copy Error","Cannot copy to null file name")        
  142.         q=strindex(r,"\",0,@FWDSCAN) ; Directory Name in there??
  143.         CopyMoveDefault=r
  144.         if q==0 then SetDisplay("","","") ;Nope. Set flag to update directory
  145.         FileCopy(s,r,@TRUE)
  146.         OtherUpdate()
  147.         drop(r,s,q)
  148.  &Move/Rename...  \  {F7}
  149.         r=OtherDir()
  150.         if r!=DirGet() then goto NEXT
  151.         if CopyMoveDefault!="" then r=CopyMoveDefault
  152.         :NEXT
  153.         s=strcat(DirItemize("")," ",FileItemize(""))
  154.         terminate(strlen(s)==1,"Move Error","No files selected")
  155.         if !IsKeyDown(@SHIFT) then r=strtrim(askline("Move",StrCat(s,CR,CR,"to"),r))
  156.         terminate(r=="","Move Error","Cannot move to null file name")
  157.         SetDisplay("","","") ;Set flag to update directory
  158.         CopyMoveDefault=r
  159.         FileMove(s,r,@TRUE)
  160.         OtherUpdate()
  161.         drop(r,s)
  162.  &Delete File... \ {DEL}
  163.         f=FileItemize("")
  164.         if IsKeyDown(@SHIFT) then goto doit
  165.         g=FileSize(f)
  166.         i=ItemCount(f," ")
  167.         terminate(strlen(f)==0,"delete","No files specified")
  168.         if askyesno("Delete %i% files:  %g% bytes ",f)==@NO then exit
  169.         :doit
  170.         SetDisplay("","","") ;Set flag to update directory
  171.         FileDelete(f)
  172.         OtherUpdate()  ; Well if the "other" CmdPost Window points to the
  173.                     ; same directory, it *IS* nice...
  174.         drop(f,g,b)
  175.  
  176.  &Print...
  177.         s=FileItemize("")
  178.         terminate(strlen(s)==0,"Print Error","No files selected")
  179.         TextPrinter=inireadpvt(IniSection,"TextPrinter","ASK",IniFile)
  180.         if TextPrinter!="ASK" then goto NOASK1
  181.         r=AskYesNo("Attention",strcat("This print routine only works with standard printers.",CR,"Do you have a standard (NON-Postscript) printer?"))
  182.         if r==@YES then goto ASK1
  183.         iniwritepvt(IniSection,"TextPrinter","NONE",IniFile)
  184.         MenuChange("FilePrint",@DISABLE)
  185.         Exit
  186.         :ASK1
  187.         TextPrinter="NONE|LPT1|LPT2|LPT3"
  188.         TextPrinter=ItemSelect("Choose the STD text printer",TextPrinter,"|")
  189.         terminate(strlen(TextPrinter)==0,"Error","Nothing chosen")
  190.         iniwritepvt(IniSection,"TextPrinter",TextPrinter,IniFile)
  191.         :NOASK1
  192.         Terminate(TextPrinter=="NONE","ERROR","No Text Printers on system")
  193.         a=AskLine("Print",strcat(s,CR,CR,"to"),TextPrinter)
  194.         FileCopy(s,a,@FALSE)
  195.         
  196.  _File &Info
  197.         call("wwwmenus.dll","FILEINFO")
  198.         
  199.  &Freespace on Local Drives   
  200.  
  201.         call("wwwmenus.dll","FREESPACE")
  202.                    
  203.  _E&xit Windows \ ^X
  204.         EndSession()
  205.         
  206.  |Find file
  207.   On DOS Path
  208.          a=AskLine("Locate file in path","Enter file name to locate",CurrentFile())
  209.          b=FileLocate(a)
  210.          terminate(b=="",a,"File Not Located")
  211.          if AskYesNo(b,"File Located.%CR%Change to that directory?")==@NO then exit
  212.          DirChange(FilePath(b))
  213.          SetDisplay("","","")
  214.   On Current Drive
  215.         Mask=Askline("Find File on drive","Enter file name to locate","*.bak")
  216.         FileList=""
  217.         tot=0
  218.         totdir=0
  219.         DirChange("\")
  220.         LocalList=FileItemize(Mask)
  221.         if LocalList=="" then goto skip11
  222.         tot = FileSize(LocalList)
  223.         totdir=1
  224.         LocalList=strcat(" ",strsub(LocalList,1,strlen(LocalList)-1))
  225.         locdir=DirGet()
  226.         LocalList=strreplace(LocalList," "," %locdir%")
  227.         FileList=LocalList
  228.         Drop(LocalList)
  229.         :Skip11
  230.         level=1
  231.         dir1=DirGet()
  232.         sub1 = DirItemize("*.*")
  233.         numdir1 = ItemCount(sub1, " ")
  234.         index1 = 0
  235.   
  236.         :loop
  237.         If index%level% == numdir%level% Then Goto upalevel
  238.         index%level% = index%level% + 1
  239.         DirChange(StrCat(dir%level%, ItemExtract(index%level%, sub%level%, " ")))
  240.         LocDir = DirGet()
  241.         LocalList=FileItemize(Mask)
  242.         if LocalList=="" then goto skip22
  243.         totdir=totdir+1
  244.         tot = tot + FileSize(LocalList)
  245.         LocalList=strcat(" ",strsub(LocalList,1,strlen(LocalList)-1))
  246.         LocalList=strreplace(LocalList," "," %locdir%")
  247.         FileList=Strcat(FileList,LocalList)
  248.         drop(LocalList)
  249.         :skip22
  250.         level = level + 1
  251.         dir%level%=LocDir
  252.         sub%level% = DirItemize("*.*")
  253.         numdir%level% = ItemCount(sub%level%, " ")
  254.         index%level% = 0
  255.         goto loop
  256.   
  257.         :upalevel
  258.         drop(dir%level%,sub%level%,index%level%,numdir%level%)
  259.         level=level-1
  260.         if level!=0 then goto loop
  261.  
  262.         :done
  263.         ; -----------
  264.         ; Termination
  265.         ; -----------
  266.         If StrLen(tot) < 9 Then tot = StrCat(StrFill("", 9 - StrLen(tot)), tot)
  267.         tot = StrCat(StrSub(tot,1,3),",",StrSub(tot,4,3),",",StrSub(tot,7,3))
  268.         tot = StrTrim(tot)
  269.         If StrSub(tot, 1, 1) == "," Then tot = StrSub(tot, 2, StrLen(tot) - 1)
  270.         tot = StrTrim(tot)
  271.         If StrSub(tot, 1, 1) == "," Then tot = StrSub(tot, 2, StrLen(tot) - 1)
  272.         tot = StrTrim(tot)
  273.         if FileList!="" then FileList=Strsub(FileList,2,strlen(FileList)-1)
  274.         level=ItemCount(FileList," ")
  275.         SelectedFile=ItemSelect("%totdir% SubDirs.  %level% Files. %tot% bytes.",FileList," ")
  276.         if SelectedFile=="" then goto GOOMBYE
  277.         DirChange(FilePath(SelectedFile))
  278.         SetDisplay("","","")
  279.         :GOOMBYE
  280.         drop(tot,level,totdir,FileList,SelectedFile)
  281.         
  282.  _&Hilite Files
  283.   By Names
  284.         a=AskLine("Hilite Files","Enter types of files to hilite",strcat("*.",FileExtension(CurrentFile())))
  285.         FileHilite(a,@TRUE)
  286.   By Attribute
  287.         :askagain
  288.         a="Enter an attribute to hilite. R A S  or H"
  289.         b="Use CAPS to hilite if attribute is set,"
  290.         c="Use lowercase to hilite if not set."
  291.         a=strcat(a,CR,b,CR,c,CR,"Enter only one character. R A S or H")
  292.         drop(b,c)
  293.         a=AskLine("Hilite by Attribute",a,"A")
  294.         if strlen(a)!=1 then goto askagain
  295.         case=2
  296.         if (a=='R' || a=='A' || a=='S' || a=='H') then case=1
  297.         if (a=='r' || a=='a' || a=='s' || a=='h') then case=0
  298.         a=strupper(a)
  299.         if case==2 then goto askagain
  300.         d=FileItemize("*.*")
  301.         e=ItemCount(d," ")
  302.         f=0
  303.         :loop
  304.         f=f+1
  305.         if f>e then exit
  306.         q=ItemExtract(f,d," ")
  307.         g=FileAttrGet(q)
  308.         h=strscan(g,a,1,@FWDSCAN)
  309.         if h>0 then h=1
  310.         ;display(3,"%a% %h%","%q% %g%:
  311.         if case==h then filehilite(q,@TRUE)
  312.         ;beep 
  313.         goto loop
  314.  &Unhilite Files
  315.   By Name
  316.         a=AskLine("Unhilite Files","Enter types of files to unhilite",strcat("*.",FileExtension(CurrentFile())))
  317.         FileHilite(a,@FALSE)
  318.   By Attribute
  319.         :askagain
  320.         a="Enter an attribute to hilite. R A S  or H"
  321.         b="Use CAPS to hilite if attribute is set,"
  322.         c="Use lowercase to hilite if not set."
  323.         a=strcat(a,CR,b,CR,c,CR,"Enter only one character. R A S or H")
  324.         drop(b,c)
  325.         a=AskLine("Hilite by Attribute",a,"A")
  326.         if strlen(a)!=1 then goto askagain
  327.         case=2
  328.         if (a=='R' || a=='A' || a=='S' || a=='H') then case=1
  329.         if (a=='r' || a=='a' || a=='s' || a=='h') then case=0
  330.         a=strupper(a)
  331.         if case==2 then goto askagain
  332.         d=FileItemize("*.*")
  333.         e=ItemCount(d," ")
  334.         f=0
  335.         :loop
  336.         f=f+1
  337.         if f>e then exit
  338.         q=ItemExtract(f,d," ")
  339.         g=FileAttrGet(q)
  340.         h=strscan(g,a,1,@FWDSCAN)
  341.         if h>0 then h=1
  342.         ;display(3,"%a% %h%","%q% %g%:
  343.         if case==h then filehilite(q,@FALSE)
  344.         ;beep 
  345.         goto loop
  346.  
  347.  _File Attributes
  348.   View/Modify current file
  349.         DaFile=CurrentFile()
  350.         :REDO
  351.         attr=FileAttrGet(DaFile)
  352.         RD=2
  353.         AR=2
  354.         SY=2
  355.         HD=2
  356.         if strsub(attr,1,1)=="R" then  RD=1
  357.         if strsub(attr,2,1)=="A" then  AR=1
  358.         if strsub(attr,3,1)=="S" then  SY=1
  359.         if strsub(attr,4,1)=="H" then  HD=1
  360.         OldHD=HD
  361.         OldSY=SY
  362.         b=@YES
  363.         ATTR2Format=`WWWDLGED,4.0`
  364.  
  365.         ATTR2Caption=`View/Modify Attributes`
  366.         ATTR2X=-1
  367.         ATTR2Y=-1
  368.         ATTR2Width=209
  369.         ATTR2Height=141
  370.         ATTR2NumControls=11
  371.  
  372.         ATTR201=`6,4,198,DEFAULT,VARYTEXT,DaFile,"<FileName>"`
  373.         ATTR202=`12,32,64,DEFAULT,RADIOBUTTON,RD,"ReadOnly",1`
  374.         ATTR203=`12,44,64,DEFAULT,RADIOBUTTON,RD,"Read/Write",2`
  375.         ATTR204=`132,32,64,DEFAULT,RADIOBUTTON,AR,"Needs Archiving",1`
  376.         ATTR205=`132,44,64,DEFAULT,RADIOBUTTON,AR,"Archived",2`
  377.         ATTR206=`12,70,64,DEFAULT,RADIOBUTTON,HD,"Hidden",1`
  378.         ATTR207=`12,82,64,DEFAULT,RADIOBUTTON,HD,"Normal",2`
  379.         ATTR208=`132,70,64,DEFAULT,RADIOBUTTON,SY,"System",1`
  380.         ATTR209=`132,82,64,DEFAULT,RADIOBUTTON,SY,"Normal",2`
  381.         ATTR210=`24,114,64,DEFAULT,PUSHBUTTON,DEFAULT,"&Ok",1`
  382.         ATTR211=`124,114,64,DEFAULT,PUSHBUTTON,DEFAULT,"&Cancel",2`
  383.  
  384.         Dialog("ATTR2")
  385.  
  386.         If OldHD!=HD then b=AskYesNo("Attribute Changer","Note: Changing Hidden attribute is unusual%CR%Continue?")
  387.         if b==@NO then goto REDO
  388.         If OldSy!=SY then b=AskYesNo("Attribute Changer","Note: Changing System attribute is unusual%CR%Continue?")
  389.         if b==@NO then goto REDO
  390.         attr=""
  391.         if RD==1 then attr="R"
  392.         if RD==2 then attr='r'
  393.         if AR==1 then attr=strcat(attr,"A")
  394.         if AR==2 then attr=strcat(attr,"a")
  395.         if HD==1 then attr=strcat(attr,"H")
  396.         if HD==2 then attr=strcat(attr,"h")
  397.         if SY==1 then attr=strcat(attr,"S")
  398.         if SY==2 then attr=strcat(attr,"s")
  399.         FileAttrSet(DaFile,attr)
  400.         Drop(ATTR2Format,ATTR2Caption,ATTR2X,ATTR2Y,ATTR2Width,ATTR2Height)
  401.         Drop(ATTR2NumControls,ATTR201,ATTR202,ATTR203,ATTR204,ATTR205,ATTR206)
  402.         Drop(ATTR207,ATTR208,ATTR209,ATTR210,ATTR211,RD,AR,HD,SY,attr,OldHD)
  403.         Drop(OldSY,b,DaFile)
  404.         SetDisplay("","","")
  405.         
  406.  
  407.   Change hilited files
  408.         a=FileItemize("")
  409.         terminate(a=="","Attribute Changer","No files Hilited")
  410.         string=a
  411.         if strlen(string)<35 then goto REDO
  412.         string=strcat(strfix(string," ",35)," ...")
  413.         :REDO
  414.         RD=3
  415.         AR=3
  416.         SY=3
  417.         HD=3
  418.         b=@YES
  419.         ATTR1Format=`WWWDLGED,4.0`
  420.  
  421.         ATTR1Caption=`File Attribute Changer`
  422.         ATTR1X=-1
  423.         ATTR1Y=-1
  424.         ATTR1Width=209
  425.         ATTR1Height=141
  426.         ATTR1NumControls=15
  427.  
  428.         ATTR101=`4,4,194,DEFAULT,VARYTEXT,String,""`
  429.         ATTR102=`18,30,64,DEFAULT,RADIOBUTTON,RD,"ReadOnly",1`
  430.         ATTR103=`18,42,64,DEFAULT,RADIOBUTTON,RD,"Read/Write",2`
  431.         ATTR104=`18,54,64,DEFAULT,RADIOBUTTON,RD,"No Change",3`
  432.         ATTR105=`128,30,74,DEFAULT,RADIOBUTTON,AR,"Needs Archiving",1`
  433.         ATTR106=`128,42,64,DEFAULT,RADIOBUTTON,AR,"Archived",2`
  434.         ATTR107=`128,54,64,DEFAULT,RADIOBUTTON,AR,"No Change",3`
  435.         ATTR108=`18,78,64,DEFAULT,RADIOBUTTON,HD,"Hidden",1`
  436.         ATTR109=`18,90,64,DEFAULT,RADIOBUTTON,HD,"Normal",2`
  437.         ATTR110=`18,102,64,DEFAULT,RADIOBUTTON,HD,"No Change",3`
  438.         ATTR111=`128,78,64,DEFAULT,RADIOBUTTON,SY,"System",1`
  439.         ATTR112=`128,90,64,DEFAULT,RADIOBUTTON,SY,"Normal",2`
  440.         ATTR113=`128,102,64,DEFAULT,RADIOBUTTON,SY,"No Change",3`
  441.         ATTR114=`14,122,64,DEFAULT,PUSHBUTTON,DEFAULT,"&Ok",1`
  442.         ATTR115=`128,122,64,DEFAULT,PUSHBUTTON,DEFAULT,"&Cancel",2`
  443.  
  444.         Dialog("ATTR1")
  445.  
  446.         If HD!=3 then b=AskYesNo("Attribute Changer","Note: Changing Hidden attribute is unusual%CR%Continue?")
  447.         if b==@NO then goto REDO
  448.         If SY!=3 then b=AskYesNo("Attribute Changer","Note: Changing System attribute is unusual%CR%Continue?")
  449.         if b==@NO then goto REDO
  450.         attr=""
  451.         if RD==1 then attr="R"
  452.         if RD==2 then attr='r'
  453.         if AR==1 then attr=strcat(attr,"A")
  454.         if AR==2 then attr=strcat(attr,"a")
  455.         if HD==1 then attr=strcat(attr,"H")
  456.         if HD==2 then attr=strcat(attr,"h")
  457.         if SY==1 then attr=strcat(attr,"S")
  458.         if SY==2 then attr=strcat(attr,"s")
  459.         FileAttrSet(a,attr)
  460.         Drop(ATTR1Format,ATTR1Caption,ATTR1X,ATTR1Y,ATTR1Width,ATTR1Height)
  461.         Drop(ATTR1NumControls,ATTR101,ATTR102,ATTR103,ATTR104,ATTR105,ATTR106)
  462.         Drop(ATTR107,ATTR108,ATTR109,ATTR110,ATTR111,ATTR112,ATTR113,ATTR114)
  463.         Drop(ATTR115,RD,AR,HD,SY,attr,string)
  464.         SetDisplay("","","")
  465.  
  466.  
  467.         
  468.  _Floppy Space
  469.   A:
  470.         message(strcat("Drive A ",DiskFree("A")),strcat("Selected Files ",FileSize(FileItemize(""))))
  471.   B:
  472.         message(strcat("Drive B ",DiskFree("B")),strcat("Selected Files ",FileSize(FileItemize(""))))
  473.  
  474.  _&Network
  475.   Connect Drive to Net
  476.          AvailDrive=DiskScan(0)
  477.          DrvLen=strlen(AvailDrive)
  478.          if DrvLen==0 then goto NOMORE
  479.          AvailDrive=Strsub(AvailDrive,DrvLen-2,2)
  480.          NetPath=NetBrowse(0)
  481.          pswd=AskPassword("Enter password for",NetPath)
  482.          NetAddCon(NetPath,pswd,AvailDrive)
  483.          exit
  484.          :NOMORE
  485.          Message("Connect Drive to Net","No drives avail for assignment")
  486.          
  487.          
  488.   Disconnect
  489.          AvailDrive=DiskScan(4)
  490.          a=Itemcount(AvailDrive," ")
  491.          if a==0 then exit
  492.          i=1
  493.          DisList=""
  494.          :loop
  495.          b=ItemExtract(i,AvailDrive," ")
  496.          DisList=strcat(b,num2char(9),NetGetCon(b),"|")
  497.          i=i+1
  498.          if i<a then goto loop
  499.          AvailDrive=ItemSelect("Disconnect",DisList,"|")
  500.          NetCancelCon(AvailDrive,0)
  501.   Net Dialog
  502.          NetDialog()         
  503.          
  504.  _Preferences
  505.   Show System/Hidden Files
  506.         a=strupper(inireadpvt(IniSection,"SysHide","0",IniFile))
  507.         c="YES"
  508.         if a==0 then c="NO"
  509.         b=AskYesNo("System/Hidden Files","Show System and Hidden files?%CR%Current answer=%c%%CR%Enter desired answer")
  510.         if a!=b then iniwritepvt(IniSection,"SysHide",b,IniFile)
  511.         IntControl(5,b,0,0,0)                 ;Controls system/hidden show flag
  512.         SetDisplay("","","")
  513.  
  514.   Save CmdPost Window Positions
  515.         c=IntControl(2,0,0,0,0)     ;This guy returns # of CP Windows open
  516.         b1="Do you wish to save the current CmdPost"
  517.         b2="window positions for future startups?"
  518.         b3="Note: You can save positions of combinations"
  519.         b4="of 1, 2, 3, and 4 window positions."
  520.         b5="Now saving window positions for %c% windows"
  521.         b1=strcat(b1,CR,b2,CR,CR,b3,CR,b4,CR,b5)
  522.         drop(b2,b3,b4,b5)
  523.         a=AskYesNo("CmdPost Window Positions",b1)
  524.         if a==@YES then IntControl(3,0,0,0,0) ;This causes all cp's to write
  525.         exit                                  ;their position information
  526.  
  527.  
  528.   Auto Run= and Load= Options
  529.         a=strupper(inireadpvt(IniSection,"AutoStart","NO",IniFile))
  530.         b=AskYesNo("Auto Startup from WIN.INI","Auto start from WIN.INI RUN= and LOAD= lines?%CR%Current answer=%a%%CR%Enter desired answer")
  531.         if b==@YES then b=AskYesNo("Auto Startup from WIN.INI","Generally this option is set only%CR%when you make CmdPost your shell.%CR%Continue?")
  532.         if b==@NO then b="NO"
  533.         if b==@YES then b="YES"
  534.         if a!=b then iniwritepvt(IniSection,"AutoStart",b,IniFile)
  535.         
  536.   CmdPost Window Titles
  537.    Window 1
  538.         c=strcat("Command Post ",version()," #")
  539.         a=1
  540.         Title%a%=inireadpvt(IniSection,"Title%a%","%c%%a%",IniFile)
  541.         b=AskLine("CmdPost Title #%a%","Enter name of #%a% CmdPost window.",Title%a%)
  542.         iniwritepvt(IniSection,"Title%a%",b,IniFile)
  543.         if WinExist(Title%a%) then WinTitle(Title%a%,b)
  544.    Window 2
  545.         c=strcat("Command Post ",version()," #")
  546.         a=2
  547.         Title%a%=inireadpvt(IniSection,"Title%a%","%c%%a%",IniFile)
  548.         b=AskLine("CmdPost Title #%a%","Enter name of #%a% CmdPost window.",Title%a%)
  549.         iniwritepvt(IniSection,"Title%a%",b,IniFile)
  550.         if WinExist(Title%a%) then WinTitle(Title%a%,b)
  551.    Window 3
  552.         c=strcat("Command Post ",version()," #")
  553.         a=3
  554.         Title%a%=inireadpvt(IniSection,"Title%a%","%c%%a%",IniFile)
  555.         b=AskLine("CmdPost Title #%a%","Enter name of #%a% CmdPost window.",Title%a%)
  556.         iniwritepvt(IniSection,"Title%a%",b,IniFile)
  557.         if WinExist(Title%a%) then WinTitle(Title%a%,b)
  558.    Window 4
  559.         c=strcat("Command Post ",version()," #")
  560.         a=4
  561.         Title%a%=inireadpvt(IniSection,"Title%a%","%c%%a%",IniFile)
  562.         b=AskLine("CmdPost Title #%a%","Enter name of #%a% CmdPost window.",Title%a%)
  563.         iniwritepvt(IniSection,"Title%a%",b,IniFile)
  564.         if WinExist(Title%a%) then WinTitle(Title%a%,b)
  565.  
  566.   View Menu Startup Options
  567.         a=strupper(inireadpvt(IniSection,"ViewSetup","NO",IniFile))
  568.         b=AskYesNo("Remember View options","Should View menu options be remembered?%CR%Current answer=%a%%CR%Enter desired answer")
  569.         if b==@NO then b="NO"
  570.         if b==@YES then b="YES"
  571.         if a!=b then iniwritepvt(IniSection,"ViewSetup",b,IniFile)
  572.         
  573.   Editor Options
  574.         Editor=strtrim(strupper(AskLine("Editor Selection","Enter desired editor",Editor)))
  575.         iniwritepvt(IniSection,"Editor",Editor,IniFile)
  576.           
  577.   File Refresh
  578.    On
  579.            IniWritePvt(IniSection,"AutoUpdate",1,IniFile)
  580.            MenuChange("MainPreferencesFileRefreshOn",@CHECK)
  581.            MenuChange("MainPreferencesFileRefreshOff",@UNCHECK)
  582.    Off
  583.            IniWritePvt(IniSection,"AutoUpdate",0,IniFile)
  584.            MenuChange("MainPreferencesFileRefreshOn",@UNCHECK)
  585.            MenuChange("MainPreferencesFileRefreshOff",@CHECK)
  586.            
  587.   Default DoubleClick Program
  588.            a=IniRead("Extensions","*","Browser.exe")         
  589.            a=AskLine("Default startup program","Enter program to run for file when%CR%file extension is not defined",a)
  590.            iniwrite("Extensions","*",a)
  591.    
  592.   Reset Assorted Options
  593.         iniwritepvt(IniSection,"DriveA","ASK",IniFile)
  594.         iniwritepvt(IniSection,"DriveB","ASK",IniFile)
  595.         iniwritepvt(IniSection,"TextPrinter","ASK",IniFile)
  596.         iniwritepvt("wallpaper","WallPaperDir","ASK","WWW-PROD.INI")
  597.         MenuChange("FilePrint",@ENABLE)
  598.         b1="CmdPost's saved information reset."
  599.         b2="You will be prompted to re-enter the"
  600.         b3="necessary information when it is required."
  601.         b1=strcat(b1,CR,b2,CR,b3)
  602.         Message("Information Reset",b1)
  603.           
  604.          
  605.  _&Extensions...
  606.         a=strtrim(CurrentFile())
  607.         i=strindex(a,".",0,@FWDSCAN)
  608.         terminate(i==0,"Association Error","Associated files must have an extension")
  609.         b=FileExtension(a)
  610.         c=iniread("extensions",b,"???.EXE ^.%b%")
  611.         d=askline("Associate","%b% files are associated with",c)
  612.         terminate(c==d,"","")
  613.         iniwrite("extensions",b,d)
  614.         
  615.  
  616.  
  617.  
  618.  
  619.     
  620.